package com.google.code.virtualhockey.vhx.shared.error;

/**
 * Signals that the user was correctly authenticated but is not authorised to
 * access a page or carry out the action he intends to do.
 */
public class WebNotAuthorisedException extends WebSecurityException
{
  /** URL of a possible error page. */
  private String m_strErrorRedirectUrl;

  /** Argumentless default constructor for GWT/RPC. */
  private WebNotAuthorisedException()
  {
  }

  /**
   * Creates a new WebNotAuthorisedException
   *
   * @param strMessage an exception message
   * @param strErrorRedirectUrl a URL to redirect the user to some error page (leave
   *        <code>null</code> to display some standard error message)
   * @see WebServerException
   */
  public WebNotAuthorisedException( String strMessage, String strErrorRedirectUrl )
  {
    super( strMessage );
    m_strErrorRedirectUrl = strErrorRedirectUrl;
  }

  /**
   * Returns the URL which displays a more specific error message.
   */
  public String getErrorRedirectUrl()
  {
    return m_strErrorRedirectUrl;
  }
}
